package com.information.manage.basic.common.utils.exportAndImport.custom;

import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
public class ExImportManager {

    //字体颜色样式操作对象关系
    public static Map<Class, CustomExportExcelStyleOperator> operateStyleMap = new HashMap<>();
    //表格样式操作对象关系
    public static Map<Class, CustomExportExcelTableOperator> operateTableMap = new HashMap<>();

    protected void addStyleOperator(CustomExportExcelStyleOperator customExportExcelStyleOperator){
        Class clazz = customExportExcelStyleOperator.getClass();
        operateStyleMap.put(clazz, customExportExcelStyleOperator);
    }

    protected void addStyleOperator(List<CustomExportExcelStyleOperator> customExportExcelStyleOperator){
        for (CustomExportExcelStyleOperator customExportExcelOperator : customExportExcelStyleOperator) {
            this.addStyleOperator(customExportExcelOperator);
        }
    }

    protected void addTableOperator(CustomExportExcelTableOperator customExportExcelTableOperator){
        Class clazz = customExportExcelTableOperator.getClass();
        operateTableMap.put(clazz, customExportExcelTableOperator);
    }

    protected void addTableOperator(List<CustomExportExcelTableOperator> customExportExcelTableOperator){
        for (CustomExportExcelTableOperator customExportExcelOperator : customExportExcelTableOperator) {
            this.addTableOperator(customExportExcelOperator);
        }
    }

}
